<?php
my_component_load('testing' , false);
my_component_load('paging' , false);
my_component_load('remove_node_karyawan');
$task = isset($_GET['task']) ? $_GET['task'] : ""; 
$id = isset( $_GET['id'] ) ? $_GET['id']:  0;
$kid = isset( $_GET['kid'] ) ? $_GET['kid']:  0;
 
if($task == "remove_kesehatan"){
	$_SESSION['tab_page'] = '#tab2';
	$query = "
		DELETE riwayat_kesehatan, riwayat_kesehatan_karyawan FROM riwayat_kesehatan 
		INNER JOIN riwayat_kesehatan_karyawan  
		WHERE riwayat_kesehatan.riwayat_kesehatan_id=riwayat_kesehatan_karyawan.riwayat_kesehatan_id 
		AND riwayat_kesehatan.riwayat_kesehatan_id = {$id}
	"; 
}elseif($task == "remove_keluarga"){ 
	$_SESSION['tab_page'] = '#tab5'; 
	$query ="
		DELETE FROM keluarga_karyawan WHERE keluarga_karyawan_id={$id}
	";
}elseif($task == "remove_riwayat_kerja"){ 
		$_SESSION['tab_page'] = '#tab3'; 
	$query ="
		DELETE riwayat_kerja, riwayat_kerja_karyawan FROM riwayat_kerja 
		INNER JOIN riwayat_kerja_karyawan  
		WHERE riwayat_kerja.riwayat_kerja_id=riwayat_kerja_karyawan.riwayat_kerja_id 
		AND riwayat_kerja.riwayat_kerja_id = {$id}
	";
}elseif($task == "remove_alamat"){ 
	$_SESSION['tab_page'] = '#tab7'; 
	$query ="DELETE FROM alamat WHERE alamat_id ={$id}";
 
}elseif($task == "remove_pangkat"){ 
}elseif($task == "remove_hobi"){ 
	$_SESSION['tab_page'] = '#tab6'; 
	$query = "DELETE   hobi , hobi_karyawan 
	FROM hobi
	INNER JOIN hobi_karyawan 
	WHERE hobi.hobi_id=hobi_karyawan.hobi_id
	AND hobi.hobi_id={$id}"; 
}elseif($task == "remove_status"){ 
}elseif($task == "remove_pendidikan"){ 
	 $query = "DELETE   riwayat_pendidikan , riwayat_pendidikan_karyawan 
	FROM riwayat_pendidikan
	INNER JOIN riwayat_pendidikan_karyawan 
	WHERE riwayat_pendidikan.riwayat_pendidikan_id = riwayat_pendidikan_karyawan.riwayat_pendidikan_id
	AND riwayat_pendidikan.riwayat_pendidikan_id = {$id}";
	

// Kekaryawanan	
}elseif($task == "edit_jabatan"){ 
	$query= "DELETE FROM kekaryawanan_jabatan WHERE kekaryawanan_jabatan_id = {$id}";
}elseif($task == "edit_kompetensi"){ 
	$query= "DELETE FROM kekaryawanan_kompetensi WHERE karyawan_id = {$id}";
}
my_query($query);
my_direct($_SERVER['HTTP_REFERER']);
?>